<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>次品转换记录</title>

<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script> 
<style type="text/css">
#searchbar{
   margin-bottom: 10px;
   margin-left:15px;
  }
  .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>

<body style="padding:6px; overflow:hidden;">
<div class="navbar">
		<span>您当前的位置：</span>
		商品管理 &gt; 次品转换记录
</div>

<%--<form action="	" method="post" >
 <div id="searchbar"><br>

商品编号：<input type="text" id="productId" name="productId" value="${defective.productId}">&nbsp;&nbsp;
商品名称：<input type="text" id="productName" name="productName" value="${defective.productName}" />&nbsp;&nbsp;
审核状态：<select id="checkState" name="checkState">
         		<option value="-1">请选择</option>
         		<option value="0" ${commodity.checkState == 0 ? "selected='selected'" : ""}>未审核</option>
         		<option value="1" ${commodity.checkState == 1 ? "selected='selected'" : ""}>已审核</option>
         		<option value="2" ${commodity.checkState == 2 ? "selected='selected'" : ""}>已拒绝</option>
         	</select><br><br>
货品编号：<input type="text" id="prodNo" name="prodNo" value="${commodity.prodNo}">&nbsp;&nbsp;
创建时间：<input type="text" id="createStartDate" name="createStartDate" value="${commodity.createStartDate}" class="Wdate" value="" size="21" readonly="readonly"
			onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,autoPickDate:true,maxDate:'#F{$dp.$D(\'createEndDate\')||\'2020-10-01\'}'})"> - 
		 <input type="text" id="createEndDate" name="createEndDate" value="${commodity.createEndDate}" class="Wdate" value="" size="21" readonly="readonly"
			onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,autoPickDate:true,minDate:'#F{$dp.$D(\'createStartDate\')||\'2013-01-01\'}'})" >

         <input type="submit" id="btnSearch" value="查询" class="l-button-search" />
           <input type="button" id="btnReset" value="重置" class="l-button-search" />
</div> --%>
<br />
<form action="#" name="queryForm" id="queryForm" method="POST" >
<div id="searchbar"><br>
次品编号：<input type="text" id="id" name="id" value="${defective.id}" />&nbsp;&nbsp;
商品名称：<input type="text" id="commoName" name="commoName" value="${defective.commoName}" />&nbsp;&nbsp;
仓库名称：<input type="text" id="whName" name="whName" value="${defective.whName}" />&nbsp;&nbsp;
        <input type="submit" id="btnSearch" value="查询" class="l-button-search" />
        <input type="button" id="btnReset" value="重置" class="l-button-search" />
</div>
</form>
<br />
<div id="maingrid" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- 展示列表数据  -->
</div>

	<script>
    var basePath='${BasePath}';
    var grid = null;
	
    $(function () {
    	 // 重置
        $("#btnReset").click(function(){
    		$('#searchbar :input').not(':submit, :button, :reset').val('').removeAttr('checked').removeAttr('selected');
    	});
    	
       /*  $("#id").show()表示display:block, 
        $("#id").hide()表示display:none;  */
        grid = $("#maingrid").ligerGrid({
            columns: [
            { display: '次品编号', name: 'id'},
            { display: '货品编号', name: 'prodNo'},
            { display: '商品编号', name: 'commoNo'},
            { display: '商品名称', name: 'commoName'},
            { display: '仓库名称', name: 'whName'},
            { display: '供应商名称', name: 'supName'},
            { display: '规格', name: 'specName'},
            { display: '采购单号', name: 'poNo'},
            { display: '处理方式', name: 'dealWith' ,render:function(rowdata,rowindex,value){
	            var text = null;
	            switch(value){
		            case 1: text="退货"; break;
		            case 2: text="换货"; break;  
		            case 3: text="其他"; break;
		            case 4: text="无法修复"; break; 
	            default : break; 
            }
            return text;
       	 	}},
            /* { display: '入库方式', name: 'storageMethods',render:function(rowdata,rowindex,value){
	            var text = null;
	            switch(value){
		            case 1: text="采购入库"; break;
		            case 2: text="销售退货入库"; break;
		            case 3: text="其他入库"; break;  
		            default : break; 
            	}
            return text;
       	 	}}, */
	       	 { display: '原良品数量', name: 'changedQualifiedQuantity',render:function(rowdata,rowindex,value){
	       		 return (parseInt(value) + parseInt(rowdata.defectiveNumber)) + '';
	         }},
	       	/*  { display: '原次品数量', name: 'changedDefectiveQuantity',render:function(rowdata,rowindex,value){
	       		 return (parseInt(value) - parseInt(rowdata.defectiveNumber)) + '';
	         }}, */
	       	 { display: '转换数量', name: 'defectiveNumber'},
	         { display: '转换后良品数量', name: 'changedQualifiedQuantity',width:100},
       	 	 { display: '转换后次品数量', name: 'changedDefectiveQuantity',width:100},
	         { display: '次品原因', name: 'defectiveReason'},
            ], 
            pageSize:30,
            width: '100%',
            height: '100%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
            parms: [
					{name: "id", value:$("#id").val()},
					{name: "commoName", value:$("#commoName").val()},
					{name: "whName", value:$("#whName").val()}
                    ],
			url: basePath+'/product/defectivemgt/list_history_defective.do',
        });
    });
</script>
	
</body>
</html>